/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.jeck.action.cu_evento.nuevo.data;

import com.jeck.conexion.Conector;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author bicho
 */
public class mg_Evento {
    static Conector cn = new Conector();

    public static int crearEvento(String user, String pass, String nombreEvento,
        String descripcion, String fecha_inicio, String fecha_fin){

        String query ="SELECT * FROM create_event" +
                "('"+user+"','"+pass+"','"+nombreEvento+"','"+descripcion+"'," +
                "'"+fecha_inicio+"','"+fecha_inicio+"');";
                
        ResultSet rs = cn.Consultar(query);

        try {
            while(rs.next()){
                    return rs.getInt(1);
            }
        } catch (SQLException ex) {
                System.out.println(ex.getMessage());
        }
        return 0;
    }

}
